package com.example.om_export.system.config;

import com.example.om_export.common.entity.Result;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * controller全局配置
 * 主要用来捕获异常
 * @author wb-ycl473317
 */
@RestControllerAdvice
@Profile("prod")
public class ControllerAdviceConfig {

    /**
     * 全局异常处理
     * @return
     */
    @ExceptionHandler(value = Exception.class)
    public Result errorHander(){
        return Result.error();
    }

}
